/*
 * @Author: 张笑天
 * @Date: 2018-03-07 17:08:16
 * @Last Modified by: 张笑天
 * @Last Modified time: 2018-03-09 15:28:02
 */
import { WeaTools } from 'ecCom';

const { callApi } = WeaTools;

const configUrl = '/api/email/base/getEmailAllConfig';
const sizeUrl = '/api/email/folder/getEmailSize';
const deleteUrl = '/api/email/base/deleteEmail';
const readStatusUrl = '/api/email/base/setReadStatus';
const starUrl = '/api/email/base/setStar';
const todoConditionsUrl = '/api/email/waitdeal/conditions';
const saveTodoUrl = '/api/email/waitdeal/addOrUpdateWaitDeal';
const setTodoUrl = '/api/email/waitdeal/completeWaitdeal';
const folderUrl = '/api/email/setting/operateUserMailFolder';
const tagUrl = '/api/email/setting/operateUserMailLabel';
const recallUrl = '/api/email/view/recall';
const docUrl = '/api/email/export/docs';
const crmUrl = '/api/email/export/crmContactRecord';
const emlUrl = '/api/email/export/eml';
const htmlUrl = '/api/email/export/html';
const commonOperationUrl = '/api/email/base/EmailCommonOperation';
const emailUpgrade = '/api/email/base/emailUpgrade';
const emailWaitdealCondition = '/api/email/waitdeal/emailWaitdealCondition';
const emailIdentifyInvoice = '/api/email/base/emailIdentifyInvoice';

export default {
  getConfig: params => callApi(configUrl, 'GET', params),
  getEmailSize: params => callApi(sizeUrl, 'GET', params),
  deleteEmail: params => callApi(deleteUrl, 'GET', params),
  setReadStatus: params => callApi(readStatusUrl, 'GET', params),
  setStar: params => callApi(starUrl, 'GET', params),
  getTodoConditions: params => callApi(todoConditionsUrl, 'GET', params),
  saveTodo: params => callApi(saveTodoUrl, 'POST', params),
  setTodoComplete: params => callApi(setTodoUrl, 'GET', params),
  moveToFolder: params => callApi(folderUrl, 'POST', params),
  setTag: params => callApi(tagUrl, 'POST', params),
  recall: params => callApi(recallUrl, 'POST', params),
  exportToDoc: params => callApi(docUrl, 'GET', params),
  exportToCrm: params => callApi(crmUrl, 'GET', params),
  exportToEml: params => callApi(emlUrl, 'GET', params),
  exportToHtml: params => callApi(htmlUrl, 'GET', params),
  commonOperation: params => callApi(commonOperationUrl, 'POST', params),
  emailUpgrade: params => callApi(emailUpgrade, 'GET', params),
  emailWaitdealCondition: params => callApi(emailWaitdealCondition, 'GET', params),
  emailIdentifyInvoice: params => callApi(emailIdentifyInvoice, 'POST', params),
};
